import { exec } from "child_process";
const executeCommand: any = (command: string) => {
  return new Promise((resolve, reject) => {
    exec(command, (error: any, stdout: unknown, stderr: any) => {
      if (error) {
        reject(error);
        return;
      }
      resolve(stdout);
    });
  });
};

export const getSystemVersion = () => {
  return executeCommand("git tag -l");
};

export const getSystemBranch = () => {
  return executeCommand("git symbolic-ref --short HEAD");
};
